#{extends 'main.html' /}
#{set title:'分类管理' /}

<form class="form-inline" method="post" action="@{Forum.save_board}">
    <div class="form-group">
        <label for="name">分类名称</label>
        <input type="text" name="name" class="form-control" id="name" placeholder="分类">
    </div>
    <button type="submit" class="btn btn-default">新建分类</button>
</form>
<div class="row">
    #{list boards, as:"board"}
    <div class="col-md-3  col-sm-4">
        <div class="panel panel-default">
            <div class="panel-heading"><a href="@{Forum.list_posts(board.id,0,10)}">${board.name}</a></div>
            <div class="panel-body">
                <ul class="list-group">
                    <li class="list-group-item">帖子数：${board.post_cnt}</li>
                    <li class="list-group-item">关注数：${board.follow_cnt}</li>
                    <li class="list-group-item">创建于：${board.created_at.format('yyyy-MM-dd')}</li>
                </ul>
            </div>
        </div>
    </div>
    #{/list}
</div>
